import { createStore } from 'vuex'
// 导入模块
import user from './modules/user'
import ware from './modules/ware'
import doc from './modules/doc'
import nurse from './modules/nurse'

type storetype = {
    name: string,
    age: number,
    email: string
}

// 怎么结合ts用
const store = createStore<storetype>({
    state: {
        name: '张三',
        age: 24,
        email: 'xxxx'
    },
    modules: {
        // 注册模块：模块名: 模块对象（约束模块对象呢里面的state）
        user: user,
        ware: ware,
        doc:doc,
        nurse:nurse

    }
})

export default store